package com.songlanyun.common.enums;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public enum KqBankIsUsedEnum {

    USED("1", "已激活"),//启用
    UNUSED("0", "未激活");//未启用

    private final String code;
    private final String desc;

    public String getCode() {
        return code;
    }

    public int getIntCode() {
        return Integer.parseInt(code);
    }

    public String getDesc() {
        return desc;
    }

    private static final Map lookup = new HashMap();

    static {
        for (KqBankIsUsedEnum e : KqBankIsUsedEnum.values()) {
            lookup.put(e.code, e);
        }
    }

    public static KqBankIsUsedEnum find(String code, KqBankIsUsedEnum defaultValue) {
        KqBankIsUsedEnum value = (KqBankIsUsedEnum) lookup.get(code);
        if (value == null) {
            return defaultValue;
        }
        return value;
    }


    KqBankIsUsedEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }


}
